import { func1, func2 } from '@/services/index';

export default {
  state: {
    tab: '',
    list: [],
    isLoad: false,
  },
  subscriptions: {
    setup({ dispatch, history }) {},
  },
  reducers: {
    save(state, action) {
      return {
        ...state,
        ...action.payload,
      };
    },
  },
  effects: {
    *showGuide({ type, payload }, { put, call, select }) {
      const params = {
        ...payload,
        xx: '',
      };
      const response = yield call(func1, params);

      if (response.code === 1) {
        yield put({
          type: 'save',
          payload: response.data,
        });
      }
    },
  },
};
